/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 123
 * Date: 2023-06-11
 * Time: 10:14
 */
public class Test {
    public static void main(String[] args) {
         double[] arr1 = new double[]{1.0 , 3.0 , 4.0 , 5.0 ,6.0 ,7.0 , 8.0 , 9.0 ,10.0 } ;
         int[] arr2 = new int[]{2,3,4,1,7,8,5,6,9,10} ;
         int[] arr3 = BubbleShort(arr2) ;
        for (int i:
             arr2) {
            System.out.print(i+"  ");
        }

    }

    public  static double agv(int[] array){
        int len = array.length ;
        double sum = 0 ;
        for (double i:
                array) {
            sum += i ;
        }
        return sum / len ;
    }
    public static double agv(double[] array){
        int len = array.length ;
        double sum = 0 ;
        for (double i:
             array) {
            sum += i ;
        }
        return sum / len ;

    }

    public static int[] BubbleShort(int[] arr){
        int len = arr.length ;
        for(int i = 0 ; i < len ; i++){
            for(int j = 0  ; j < len - 1 ; j ++){
                if(arr[j] > arr[j+1]) {
                    int tmp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = tmp;
                }
            }
            len -- ;
        }
        return arr ;
    }
   public static void InsertionSort (int[] arr){





   }
  public static int[] cheng(int[] nums , int n){
       



  }



}
